package com.example.traning.mall.dal.mysql.content;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.example.traning.mall.dal.dataobject.content.ContentCategory;
import com.example.traning.mall.framework.common.pojo.PageParam;
import com.example.traning.mall.framework.common.pojo.PageResult;
import com.example.traning.mall.framework.mybatis.core.mapper.BaseMapperX;
import org.apache.ibatis.annotations.Mapper;

/**
 * <p>
 * 内容-类别 Mapper 接口
 * </p>
 *
 * @author Lei Yu
 * @since 2025-04-29
 */
@Mapper
public interface ContentCategoryMapper extends BaseMapperX<ContentCategory> {

    default PageResult<ContentCategory> selectPage(PageParam pageParam) {
        return selectPage(pageParam, new LambdaQueryWrapper<ContentCategory>()
                // order by id desc
                .orderByDesc(ContentCategory::getId)
        );
    }

}
